package com.example;

import java.util.ArrayList;
import java.util.List;

public class AutoBoxingAndUnBoxingDemo {

    public static void main(String[] args) {
        // boxing
        List<Integer> list = new ArrayList<>();
        int j = 100;
        list.add(j);

        // unboxing
        int k = list.get(0);
        System.out.println(k);

        // 注意的地方
//        Integer ii = null;
//        int l = ii;
//        System.out.println(l);

        Boolean b1 = true;
        Boolean b2 = true;
        System.out.println(b1 == b2);

        Integer i1 = 100;
        Integer i2 = 100;
        System.out.println(i1 == i2);

        Integer i3 = 129;
        Integer i4 = 129;
        System.out.println(i3 == i4);

        Float f1 = 0.1f;
        Float f2 = 0.1f;
        System.out.println(f1 == f2);
    }

}
